package mypro1;
/*
 *计算１００以内的奇数和偶数的和并输出
 */
public class Testwhileandfor{
    public static void main(String[] args) {
        int sum1 = 0;
        int sum2 = 0;
        for (int a = 0; a <= 100; a++) {
            if (a % 2 != 0) {
                sum1 = sum1 + a;
            } else {
                sum2 = sum2 + a;
            }
        }
        System.out.println("奇数和为" + sum1);
        System.out.println("偶数和为" + sum2);


        System.out.println("#######################");
/*
 * 1000以内被五整除的数
 */

        int b = 1;
        for (b = 1; b <= 1000; b++) {
            if (b % 5 == 0) {
                System.out.print(b + "\t");
                if (b % 15 == 0) {
                    System.out.println();
                }
            }
        }
    }
}
